1. Field of the Invention
The present invention relates to an image forming apparatus, a control method and a storage medium.
2. Description of the Related Art
One recent strategy to save power on a device connected to a network is to switch the device to a sleep mode when a predetermined time period has elapsed without the device being used. Also, a management method is used whereby, when a sleep mode has continued for a predetermined time period, the power is automatically shut down (automatic shutdown).
When an image forming apparatus is in a sleep mode, polling and the like used by a management application in a network does not cause the image forming apparatus to return from the sleep mode, and the sleep mode continues for a predetermined time period. Accordingly, the power of the image forming apparatus is automatically shut down based on a timer value that has been accumulated since the image forming apparatus initially switched to the sleep mode. Based on the assumption of using an image forming apparatus from a plurality of computers connected to a network, Japanese Patent Laid-Open No. 2007-079925 suggests a peripheral apparatus with a temporary power-off lock function, which allows locking a power-off function executed using a power-off command and the like for a predetermined time period. For example, this can prevent a problematic situation where, when a user of a computer is attempting to use the image forming apparatus with the execution of the temporary power-off lock function, the power of the image forming apparatus is suddenly turned off due to another user transmitting a power-off command to the image forming apparatus without notification.
However, the above conventional technology has the following problems. When an image forming apparatus is operated by a management application via a network, some operations can be executed while the image forming apparatus is in a sleep mode. Examples of such operations include an operation to download font resources, distribution of updates for firmware of the image forming apparatus, acquisition of information from apparatuses, and writing of data from the management application to the image forming apparatus, e.g. a process for synchronizing address books. During the above processes, the sleep mode is maintained, and therefore there is a possibility that the sleep mode is determined to have continued for a certain time period and the automatic shutdown is executed. If the automatic shutdown is executed during the above processes, data inconsistency occurs easily, thus giving rise to the possibility that functional problems occur when, for example, turning on the power of the image forming apparatus the subsequent time.
In addition, in the form of sleep notification using a service location protocol (SLP), the image forming apparatus notifies computers in the network of the state thereof upon switching to the sleep mode, upon returning from the sleep mode, and upon shutting down. Depending on the timing of communication from the management application to the image forming apparatus, notification regarding the shutdown may be received immediately after notification regarding the return from the sleep mode. In this case, there is a possibility that the management application cannot execute a process that accompanies the shutdown process of the image forming apparatus in time.
To solve these problems, the above conventional technology suggests the use of the temporary power-off lock function. However, the conventional technology ultimately gives rise to the problem that the power cannot be turned off when a plurality of computers in the network keep setting a temporary power-off lock command for the image forming apparatus. Moreover, when the automatic shutdown is set in view of power saving, the premise is that the automatic shutdown will definitely be executed sometime, and therefore the power cannot be turned off. This is problematic in view of power saving.